package com;

import com.fz.com.fz.dao.StudentDAO;
import com.fz.entity.Teacher;
import com.fz.mapper.BookMapper;
import com.fz.mapper.TeacherMapper;
import com.fz.mybatis.MyBatisHelper;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

/**
 * Created by webrx on 2017-08-24.
 */
public class User {




    @Test
    public void ss(){
        //StudentDAO sdao = new StudentDAO();
        //sdao.add("李四四",30,"郑州");
        MyBatisHelper mh = new MyBatisHelper();
        SqlSession s = mh.getSession();
        TeacherMapper dao = s.getMapper(TeacherMapper.class);
        //List<Teacher> list = dao.query();
        List<Teacher> list = dao.show();
        for(Teacher t : list){
            System.out.println(t.getId());
            System.out.println(t.getName());
        }


    }


    @Test
    public void bb(){
        MyBatisHelper mh = new MyBatisHelper();
        SqlSession s = mh.getSession();
        BookMapper bdao = s.getMapper(BookMapper.class);

        //List<String> ns = bdao.show();
        //for(String n : ns){
        //    System.out.println(n);
        //}



        s.commit();
    }



    public static void main(String[] args) {
        Stu<Integer> stu1 = new Stu<Integer>(18);
        stu1.info();

        Stu<String> stu2 = new Stu<String>("jack");
        stu2.info();
    }
}
